package com.shunda.ysdgj.model.entity.base;

import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.v3.oas.annotations.Hidden;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.time.LocalDateTime;

@Data
public class BaseEntity {
    @TableId(type = IdType.ASSIGN_ID)
    @Schema(description = "唯一标识ID，添加操作请忽略ID")
    private Long id;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm")
    @Schema(description = "创建时间")
    @Hidden
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime created;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm")
    @Schema(description = "最后一次修改时间")
    @Hidden
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updated;

    @TableLogic(value = "0", delval = "1")
    @Hidden
    private Integer deleted;

    @Version
    @Hidden
    private Integer version;
}
